import request from "@/utils/request";
import type { DictList } from "./types";

enum ApiPath {
  FindByDictCode = "/admin/cmn/dict/findByDictCode",
  FindByParentId = "/admin/cmn/dict/findByParentId",
}

// 接口文档：http://139.198.34.216:8202/swagger-ui.html#/259682545423383208563164929702

// 根据dictCode获取字典数据列表
export const reqFindByDictCode = (dictCode: string) => {
  return request.get<any, DictList>(ApiPath.FindByDictCode + `/${dictCode}`);
};

// 根据parentId获取子集字典数据列表
export const reqFindByParentId = (parentId: number) => {
  return request.get<any, DictList>(ApiPath.FindByParentId + `/${parentId}`);
};
